Package money

Class Money

java.lang.Object
money.Money
Direct Known Subclasses:
MoneyBag, SimpleMoney

public abstract class Money extends Object
The common interface for simple Monies and MoneyBags
Author:
Kent Beck, Robert Duvall (small updates and commenting)
  • Constructor Details

    • Money

      public Money()
  • Method Details

    • add

      public abstract Money add(Money m)
      Adds given money to this money.
    • subtract

      public abstract Money subtract(Money m)
      Subtracts given money from this money.
    • multiply

      public abstract Money multiply(int factor)
      Multiplies this money by the given factor.
    • negate

      public abstract Money negate()
      Negates this money.
    • isZero

      public abstract boolean isZero()
      Tests whether this money is zero